package com.happiness.base.utils.exception;

import com.happiness.base.enums.ResultCodeEnum;

/**
 * feign返回异常处理
 * */
public class FeignErrorException  extends UnifiedException{

    public FeignErrorException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.code,resultCodeEnum.message);
    }

    public FeignErrorException(int code, String message) {
        super(code, message);
    }

    public static AssertionException systemException(ResultCodeEnum resultCodeEnum) {
        throw new AssertionException(resultCodeEnum.code, resultCodeEnum.message);
    }

    public static AssertionException systemException(String message) {
        throw new AssertionException(ResultCodeEnum.INTERNAL_ERROR.code, message);
    }

    public static AssertionException systemException(Integer code, String message) {
        throw new AssertionException(code, message);
    }
}
